#include "HybridSRContext.h"

HybridSRContext::HybridSRContext(void)
{
}

HybridSRContext::~HybridSRContext(void)
{
}

bool HybridSRContext::evalCond(HybridSRCondition* cond)
{
	std::map<std::string, std::string>::iterator itCond;
	std::map<std::string, std::string>::iterator itContext;

	std::map<std::string, std::string> condPairs = cond->getCondPairs();

	for (std::map<std::string, std::string>::iterator itCond = condPairs.begin(); itCond != condPairs.end(); ++itCond) {
		std::string refVal = itCond->second;
		
		itContext = m_contextPairs.find(itCond->first);
		if (itContext == m_contextPairs.end()) 
			return false;

		if (!equalsIgnoreCase(itContext->second, itCond->second))
			return false;
	}
	return true;
}